package com.example.loginlib

import com.example.baselib.BaseRepository
import com.example.baselib.databean.ResponseData
import com.example.baselib.databean.UserData
import huaan.com.mvvmdemo.http.RetrofitClient
import retrofit2.Response


/**
 * Author: sxygsj
 * Date: 2020/4/14 15:22
 * Description: Login model
 * History:
 * <author> <time> <version> <desc>
 * 作者姓名 修改时间 版本号 描述
 */
class LoginRepository :BaseRepository() {

    /**
     * @Description: [用户名登录请求]
     * @Param:
     * @Return:
     */
    suspend fun loginByPwd(uniqueid:String, comename:String, password:String): Response<UserData> = request{
        RetrofitClient.reqApi().loginByPwd(uniqueid, comename, password)
    }

    /**
     * 获取登录验证码
     */
    suspend fun getLoginVerCode(tel:String):Response<ResponseData<String>> = request{
        RetrofitClient.reqApi().getLoginVerCode(tel)
    }

    /**
     * 验证码登录
     */
    suspend fun loginByTel(tel: String,verCode:String):Response<UserData> = request{
        RetrofitClient.reqApi().loginByTel(tel,verCode)
    }


}